<!doctype html>
<html lang="zh-CH">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	{{--<meta name="viewport" content="width=device-width, initial-scale=1">--}}
	<title>央票通</title>
	<link rel="stylesheet" href="./resource/css/index.css">
	<link rel="stylesheet" href="./resource/css/user.css">
</head>
<body>
<!-- 头部 -->
@include('common.index_head')
<!-- 个人中心 -->
<div class="cont-user">
	<!-- 个人中心列表 -->
	@include('common.user_head')
	<div class="user-center">
		<div class="main">
			<!-- 个人中心列表 -->
			@include('common.user_left')
			<div class="user-container left">
				<div class="user-title user-bank">
					<div class="title">
						<div class="h left">银行卡管理</div>
						<div class="small right"><span>绑定银行卡</span>&#62<span>添加银行卡</span></div>
					</div>
					<?php   $user_info = session_get(UserEnum::USER_INFO_SESSION_KEY);?>
					<div class="user-box">
						@if(empty($user_bank))
						<!-- {{ Form::open(['url'=>'/user_bankcard_bound', 'files' => true, 'method' => 'post']) }} -->
							<div class="form-group">
								<label for="" class="left control-label">姓名：</label>
								<input type="text" id="bound_name"  disabled="true "class="left form-control" value="<?php echo  $user_info->real_name;?>" name="bound_name">
							</div>
						<div class="form-group">
							<label for="" class="left control-label">身份证：</label>
							<input type="text" id="id_card"  disabled="true "class="left form-control" value="<?php echo  $user_info->id_card;?>" name="bound_name">
						</div>
							<div class="form-group">
								<label for="" class="left control-label">银行卡号：</label>
								<input type="text" class="left form-control" id="bank_num" placeholder="请填写银行卡号" name="bank_num">
							</div>
							<div class="form-group">
								<label for="" class="left control-label">选择银行：</label>
								<span class="bank-name" id="bank_name"></span>
								<input type="hidden"  id="bank_code">
								<a href="javascript:void(0)" class="chose-bank" id="chosebank" >请选择</a>

							</div>
							<div class="form-group form-code">
								<label for="" class="left control-label">开户城市：</label>
								<select name="province" id="sel_province" class="left form-control sel-code" ></select>
								<select name="city" id="sel_city" class="left form-control sel-code"></select>
								<select name="area" id="sel_area" class="left form-control sel-code"></select>
							</div>
							<div class="form-group">
								<label for="" class="left control-label">开户行：</label>
								<input type="text" id="kaihuhang"class="left form-control" placeholder="例如：工商银行南山某某支行">
							</div>
							<div class="form-group">
								<label for="" class="left control-label">银行预留手机号：</label>
								<input type="text" class="left form-control" disabled="true " value="<?php echo  $user_info->mobile;?>"id="bound_mobile" name="bound_mobile">
							</div>
							<div class="form-group">
								<div class="btn-box">
									<button type="submit" class="btn btn-default left" onclick="getbankpostal()">添加</button>
									<a class="btn btn-remove left" style="display: block;line-height: 30px;" href="/user_bankcard">取消</a>
								</div>
							</div>
							 <input type="hidden" id="userid"  name='userid' value="<?php  echo session_get(UserEnum::USER_INFO_USER_ID);?>">
						<!-- {{ Form::close() }} -->
						@else
						{{--{{ Form::open(['url'=>'/user_bankcard_bound', 'files' => true, 'method' => 'post']) }}--}}
						<input type="hidden" name="bank_id" value="{{$user_bank->bank_id}}"id="bank_id">
						<div class="form-group">
							<label for="" class="left control-label">姓名：</label>
							<input type="text" id="bound_name"  disabled="true "class="left form-control" value="{{$user_info->real_name}}" name="bound_name">
						</div>
							<div class="form-group">
								<label for="" class="left control-label">身份证：</label>
								<input type="text" id="id_card"  disabled="true "class="left form-control" value="{{$user_info->id_card}}" name="id_card">
							</div>
						<div class="form-group">
							<label for="" class="left control-label">银行卡号：</label>
							<input type="text" class="left form-control" id="bank_num" placeholder="请填写银行卡号" name="bank_num" value="{{$user_bank->bank_num}}">
						</div>
						<div class="form-group">
							<label for="" class="left control-label">选择银行：</label>
							<span class="bank-name" id="bank_name">{{$user_bank->bank_name}}</span>
							<input type="hidden" value="{{$user_bank->bank_code}}" id="bank_code">
							<a href="javascript:void(0)" class="chose-bank" id="chosebank" >请选择</a>

						</div>
						<div class="form-group form-code">
							<label for="" class="left control-label">开户城市：</label>
							<select name="province" id="sel_province" class="left form-control sel-code" rel="{{$user_bank->province}}"></select>
							<select name="city" id="sel_city" class="left form-control sel-code"  rel="{{$user_bank->city}}"></select>
							<select name="area" id="sel_area" class="left form-control sel-code"  rel="{{$user_bank->area}}"></select>
						</div>
						<div class="form-group">
							<label for="" class="left control-label">开户行：</label>
							<input type="text" id="kaihuhang" name='kaihuhang' class="left form-control" placeholder="例如：工商银行南山某某支行" value="{{$user_bank->kaihuhang}}">
						</div>
						<div class="form-group">
							<label for="" class="left control-label">银行预留手机号：</label>
							<input type="text" class="left form-control" disabled="true " value="<?php echo  $user_info->mobile;?>"id="bound_mobile" name="bound_mobile">
						</div>
						<div class="form-group">
							<div class="btn-box">
								<button  value="确定" class="btn btn-default left" onclick="getbankpostal2()">确定</button>
								<a class="btn btn-remove left" style="display: block;line-height: 30px;" href="/user_bankcard">取消</a>
							</div>
						</div>
						<input type="hidden" id="userid"  name='userid' value="<?php  echo session_get(UserEnum::USER_INFO_USER_ID);?>">
						{{--{{ Form::close() }}--}}
						@endif
						<div class="banks-choice">
							<div class="banks-title">请选择银行<div class="close"></div></div>
							<div class="banks">
								<ul>
									<li class="li_1"><label for="a"><input name="bank" type="radio" value="中国工商银行" id="a" shorthand="ICBC"/></label></li>
									<li class="li_2"><label for="b"><input name="bank" type="radio" value="中国建设银行" id="b" shorthand="CCB"/></label></li>
									<li class="li_3"><label for="c"><input name="bank" type="radio" value="招商银行" id="c" shorthand="CMB"/></label></li>
									<li class="li_4"><label for="d"><input name="bank" type="radio" value="中国邮政储蓄银行" id="d" shorthand="PSBC"/></label></li>
									<li class="li_5"><label for="e"><input name="bank" type="radio" value="交通银行" id="e" shorthand="BCM"/></label></li>
									<li class="li_6"><label for="f"><input name="bank" type="radio" value="中国银行" id="f" shorthand="BOC"/></label></li>
									<li class="li_7"><label for="g"><input name="bank" type="radio" value="北京银行" id="g" shorthand="BOB"/></label></li>
									<li class="li_8"><label for="h"><input name="bank" type="radio" value="中信银行" id="h" shorthand="CITIC"/></label></li>
									<li class="li_9"><label for="i"><input name="bank" type="radio" value="华夏银行" id="i" shorthand="HXB"/></label></li>
									{{--<li class="li_10"><label for="j"><input name="bank" type="radio" value="中国光大银行" id="j" shorthand="CEB"/></label></li>--}}
									<li class="li_11"><label for="k"><input name="bank" type="radio" value="中国民生银行" id="k" shorthand="CMBC"/></label></li>
									<li class="li_12"><label for="l"><input name="bank" type="radio" value="中国农业银行" id="l" shorthand="ABC"/></label></li>
									<li class="li_13"><label for="m"><input name="bank" type="radio" value="广发银行" id="m" shorthand="CGB"/></label></li>
									<li class="li_14"><label for="n"><input name="bank" type="radio" value="南京银行" id="n" shorthand="NJCB"/></label></li>
									<li class="li_15"><label for="o"><input name="bank" type="radio" value="宁波银行" id="o" shorthand="NBCB"/></label></li>
									<li class="li_16"><label for="p"><input name="bank" type="radio" value="平安银行" id="p" shorthand="PAB"/></label></li>
								</ul>
							</div>
							<div class="banks-foot">
								<button class="btn btn-enter">确定</button><button class="btn btn-cancel">取消</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<!-- footer -->
@include('common.index_foot')
<script src="./resource/js/jquery-1.11.3.min.js"></script>
<script src="./resource/js/index.js"></script>
<script src="./resource/js/user.js"></script>
<script src="./resource/js/province_city.js"></script>
<script src="./resource/jquery/banaddnk.js"></script>
<!-- 城市联动下拉 -->
<script>
	var pVal = $('#sel_province').attr('rel');
	var cVal = $('#sel_city').attr('rel');
	var aVal = $('#sel_area').attr('rel');
	region_init('sel_province','sel_city','sel_area',pVal,cVal,aVal);


	var inputVal = [];
//	console.log( $('input.form-control').length);
	for(i=0;i<$('input.form-control').length;i++){
		inputVal = ($('input.form-control').eq(i).val());
	}
	console.log(inputVal);
	$('.btn-box button').click(function (){
		if( inputVal == ''){
			$(this).attr('type','button');
//			console.log(typeof inputVal);
			console.log(inputVal);
		}else{
			$(this).attr('type','submit');
			console.log(111);
		}
	});
</script>
</body>
</html>